<?php
	require('class_check.php');
	$Check = new Check();
?>
<!DOCTYPE HTML >
<html>
<head>
<title> NIP </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="Stylesheet" type="text/css" href="css/style.css"/>
<body>
	<div id="wrapper">
		<form action="index.php" method="post">
			Podaj NIP: <input type="text" name="nip">
						<input type="submit" name="send" value="Sprawdź">
		</form>
		
		<?php
			if(isset($_POST['send'])){
				$nip = $_POST['nip'];
				
				if(!empty($nip)){
					echo $Check->CheckNipFormat($nip);
				}
				else{
					echo $Check->message = "<p class='error'>Uzupełnij pole NIP</p>";
				}
			}
		?>
	</div>	
</body>
</html>